package com.emep.changzhi.analyse.repository.aqi;

import com.emep.changzhi.analyse.entity.aqi.AqiControlInfo;
import com.emep.changzhi.analyse.entity.aqi.AreaAqiMoniter;
import jdk.nashorn.internal.objects.annotations.Property;
import org.springframework.data.domain.Sort;
import org.springframework.data.jpa.domain.Specification;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

import java.util.List;
import java.util.Map;

/**
 * @author xy
 * @Description: 城市监测数据
 * @date 2018/3/28 11:32
 * @version V1.0
 */

public interface AqiCityRepository extends JpaRepository<AreaAqiMoniter, Long> {
    List<AreaAqiMoniter> findByAreaIdAndUpdate1(String area_id, String time);


    List<AreaAqiMoniter> findAll(Specification<AreaAqiMoniter> var1, Sort sort);

    @Query(value = "SELECT * FROM area_moniter_aqi WHERE area_id=:areaCode ORDER BY `update` DESC limit 1",nativeQuery = true)
    List<AreaAqiMoniter> findOneByAreaId(@Param("areaCode")String areaCode);

}
